package com.yangchuang.openpicture.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yangchuang.openpicture.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where email=#{email}")
    User getUserByEmail(@Param("email") String email);


    @Update("update user set email=#{email} where password=#{password}")
    void updateUserPasswordByEmail(@Param("email") String email, @Param("password") String password);


    @Select("select * from user where id=#{id}")
    User getUserById(@Param("id")String userid);
}